#### arm specific ####
SET(CMAKE_SYSTEM_NAME Generic)
SET(CMAKE_SYSTEM_PROCESSOR arm)
SET(CMAKE_CROSSCOMPILING TRUE)

set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
set(TOOLCHAIN_PATH "/opt/gcc-arm-none-eabi-4_9-2015q1/")
set(TOOLCHAIN_FOLDER "arm-none-eabi")
set(CMAKE_C_COMPILER "${TOOLCHAIN_PATH}bin/${TOOLCHAIN_FOLDER}-gcc")
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_PATH}bin/${TOOLCHAIN_FOLDER}-g++")
set(CMAKE_STRIP "${TOOLCHAIN_PATH}bin/${TOOLCHAIN_FOLDER}-strip")

SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PATH})
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_C_FLAGS "-mthumb -mcpu=cortex-m0  -Wall -fsigned-char -fno-builtin  -ffunction-sections -O2 -g")
set(CMAKE_EXE_LINKER_FLAGS "-static -Wl,-T -Xlinker ${PROJECT_SOURCE_DIR}/src/gnu.ld -u Default_Handler -nostartfiles -Wl,-Map -Xlinker -Wl,--gc-sections --specs=nano.specs -mthumb -mcpu=cortex-m0")

#set(TOOLCHAIN_PATH "/opt/arm/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/")
#set(TOOLCHAIN_FOLDER "arm-linux-gnueabihf")


set(UIP_USE_TELNET 0)
set(UIP_USE_WEBD 1)
set(UIP_USE_WEBC 0)
set(UIP_USE_SMTP 0)

if(UIP_USE_TELNET EQUAL 1)
	add_definitions(-DUIP_TELNET)
endif(UIP_USE_TELNET EQUAL 1)

if(UIP_USE_WEBD EQUAL 1)
	add_definitions(-DUIP_WEBD)
endif(UIP_USE_WEBD EQUAL 1)

if(UIP_USE_WEBC EQUAL 1)
	add_definitions(-DUIP_WEBC)
	set(CMAKE_C_FLAGS "-mthumb -mcpu=cortex-m0  -Wall -fsigned-char -fno-builtin  -ffunction-sections -O2 -g -fpack-struct")
endif(UIP_USE_WEBC EQUAL 1)

if(UIP_USE_SMTP EQUAL 1)
	add_definitions(-DUIP_SMTP)
endif(UIP_USE_SMTP EQUAL 1)


